package com.kc.sjwh.other;

import java.io.Serializable;

import org.apache.shiro.authc.UsernamePasswordToken;

import com.kc.sjwh.entity.po.User;

/**
 * 自定义Token
 * date: 2017年5月16日
 * @author zhangGuihua(hua7381@163.com)
 */
public class MyToken extends UsernamePasswordToken implements Serializable {
	private User user;

	@Override
	public String toString() {
		//可决定JSP中<shiro:principal/>显示的内容
		if(user.getSsdwmc()==null) {
			return user.getMc();
		}
		return user.getMc()+"("+user.getSsdwmc()+")";
	}
	
	public MyToken() {
		
	}
	public MyToken(String username, String password, Boolean rememberMe) {
		super(username, password, rememberMe);
	}

	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
}
